<!DOCTYPE html>
<html lang=zh-CN>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta property="og:description" content="samuel-24276的博客">
    <meta property="og:type" content="website">
    <meta name="description" content="samuel-24276的博客">
    <meta name="keyword"  content="aircloud">
    <link rel="shortcut icon" href="/myblog/img/favicon.ico">

    <title>
        
        kali虚拟机配置 - samuel-24276的博客 | samuel-24276&#39;s Blog
        
    </title>

    <!-- Custom CSS -->
    
<link rel="stylesheet" href="/myblog/css/aircloud.css">

    
<link rel="stylesheet" href="/myblog/css/gitment.css">

    <!--<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">-->
    <link href="//at.alicdn.com/t/font_620856_28hi1hpxx24.css" rel="stylesheet" type="text/css">
    <!-- ga & ba script hoook -->
    <script></script>
<meta name="generator" content="Hexo 7.1.1"></head>

<body>

<div class="site-nav-toggle" id="site-nav-toggle">
    <button>
        <span class="btn-bar"></span>
        <span class="btn-bar"></span>
        <span class="btn-bar"></span>
    </button>
</div>

<div class="index-about">
    <i> Like what you do, do what you like </i>
</div>

<div class="index-container">
    
    <div class="index-left">
        
<div class="nav" id="nav">
    <div class="avatar-name">
        <div class="avatar ">
            <img src="/myblog/img/avatar.jpg" />
        </div>
        <div class="name">
            <i>samuel-24276</i>
        </div>
    </div>
    <div class="contents" id="nav-content">
        <ul>
            <li >
                <a href="/myblog/">
                    <i class="iconfont icon-shouye1"></i>
                    <span>主页</span>
                </a>
            </li>
            <li >
                <a href="/myblog/tags">
                    <i class="iconfont icon-biaoqian1"></i>
                    <span>标签</span>
                </a>
            </li>
            <li >
                <a href="/myblog/archives">
                    <i class="iconfont icon-guidang2"></i>
                    <span>存档</span>
                </a>
            </li>
            <li >
                <a href="/myblog/collect/">
                    <i class="iconfont icon-shoucang1"></i>
                    <span>收藏</span>
                </a>
            </li>
            <li >
                <a href="/myblog/about/">
                    <i class="iconfont icon-guanyu2"></i>
                    <span>关于</span>
                </a>
            </li>
            
            <li>
                <a id="search">
                    <i class="iconfont icon-sousuo1"></i>
                    <span>搜索</span>
                </a>
            </li>
            
        </ul>
    </div>
    
        <div id="toc" class="toc-article">
    <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#1-%E5%AE%89%E8%A3%85%E5%B9%B6%E8%AE%BE%E7%BD%AEroot%E5%AF%86%E7%A0%81"><span class="toc-text">1.安装并设置root密码</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#2-%E8%A7%A3%E5%86%B3%E6%96%87%E5%AD%97%E4%B9%B1%E7%A0%81"><span class="toc-text">2.解决文字乱码</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#3-%E9%85%8D%E7%BD%AE%E9%95%9C%E5%83%8F%E6%BA%90%E5%B9%B6%E6%9B%B4%E6%96%B0%E8%BD%AF%E4%BB%B6%E5%BA%93"><span class="toc-text">3.配置镜像源并更新软件库</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#4-%E5%AE%89%E8%A3%85%E5%9B%BE%E5%BD%A2%E5%8C%96%E7%95%8C%E9%9D%A2%E5%B9%B6%E5%AE%8C%E5%96%84%E4%B8%AD%E6%96%87%E7%B3%BB%E7%BB%9F"><span class="toc-text">4.安装图形化界面并完善中文系统</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#5-%E4%B8%8D%E6%8E%A8%E8%8D%90%E5%81%9A%E6%B3%95"><span class="toc-text">5.不推荐做法</span></a></li></ol>
</div>
    
</div>


<div class="search-field" id="search-field">
    <div class="search-bg" id="search-bg"></div>
    <div class="search-container">
        <div class="search-input">
            <span id="esc-search"> <i class="icon-fanhui iconfont"></i></span>
            <input id="search-input"/>
            <span id="begin-search">搜索</span>
        </div>
        <div class="search-result-container" id="search-result-container">

        </div>
    </div>
</div>

        <div class="index-about-mobile">
            <i> Like what you do, do what you like </i>
        </div>
    </div>
    
    <div class="index-middle">
        <!-- Main Content -->
        


<div class="post-container">
    <div class="post-title">
        kali虚拟机配置
    </div>

    <div class="post-meta">
        <span class="attr">发布于：<span>2020-05-05 22:14:38</span></span>
        
        <span class="attr">标签：/
        
        <a class="tag" href="/myblog/tags/#linux" title="linux">linux</a>
        <span>/</span>
        
        
        </span>
        <span class="attr">访问：<span id="busuanzi_value_page_pv"></span>
</span>
</span>
    </div>
    <div class="post-content no-indent">
        <h1 id="1-安装并设置root密码"><a href="#1-安装并设置root密码" class="headerlink" title="1.安装并设置root密码"></a>1.安装并设置root密码</h1><p>grub选是，不使用网络镜像选是。<br>开机后执行命令 <code>sudo passwd root</code> ,输入当前用户密码，然后两次输入新的root密码，创建检查点供以后还原， <code>reboot</code>重启。</p>
<h1 id="2-解决文字乱码"><a href="#2-解决文字乱码" class="headerlink" title="2.解决文字乱码"></a>2.解决文字乱码</h1><ul>
<li><p>1.确定locales已经安装，用 <code>apt-get install locales</code> 命令；之后可用<code>locale -a</code>查看当前系统支持的字符集。</p>
</li>
<li><p>2.在命令行输入 <code>dpkg-reconfigure locales</code> 。进入图形化界面之后，（空格是选择，Tab是切换，*是选中），选中en_US.UTF-8和zh_CN.UTF-8，确定后，将en_US.UTF-8选为默认。</p>
</li>
<li><p>3.重启<br>输入 <code>reboot</code><br>以root身份登陆后输入 <code>ls -l</code> 发现不再乱码</p>
</li>
</ul>
<h1 id="3-配置镜像源并更新软件库"><a href="#3-配置镜像源并更新软件库" class="headerlink" title="3.配置镜像源并更新软件库"></a>3.配置镜像源并更新软件库</h1><ul>
<li><p>1.若安装虚拟机时DHCP未配置，则 <code>ping baidu.com</code> 会ping不通，需要手动配置。控制面板-&gt;网络和Internet-&gt;网络和共享中心-&gt;点击现有连接-&gt;属性-&gt;共享-&gt;两个都允许，选择虚拟机的网络连接。然后进入虚拟机进行配置:</p>
<figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#修改对应网卡的DNS的配置文件</span></span><br><span class="line"><span class="attribute">vi</span> /etc/resolv.conf </span><br><span class="line"><span class="comment">#添加域名服务器</span></span><br><span class="line">nameserver <span class="number">223.5.5.5</span> <span class="comment">#阿里的DNS</span></span><br><span class="line">nameserver <span class="number">223.6.6.6</span></span><br><span class="line">nameserver <span class="number">8.8.8.8</span> <span class="comment">#google的DNS</span></span><br><span class="line">nameserver <span class="number">8.8.4.4</span> </span><br><span class="line"><span class="comment">#重启</span></span><br><span class="line">reboot</span><br></pre></td></tr></table></figure>
</li>
<li><p>2.使用命令 <code>vim /etc/apt/sources.list</code> ，配置镜像源,添加下列内容： </p>
<figure class="highlight 1c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#阿里云源</span></span><br><span class="line">deb http:<span class="comment">//mirrors.aliyun.com/kali kali-rolling main non-free contrib</span></span><br><span class="line"><span class="meta">#中科大源</span></span><br><span class="line">deb http:<span class="comment">//mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib</span></span><br><span class="line"><span class="meta">#官方源</span></span><br><span class="line">deb http:<span class="comment">//http.kali.org/kali kali-rolling main non-free contrib</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>3.使用命令 <code>apt-get update &amp;&amp; apt-get upgrade</code> 同步源的索引，升级软件包，时间会比较长。<br>update会访问源列表里的每个网址，并读取软件列表，然后保存在本地电脑。我们在新立得软件包管理器里看到的软件列表，都是通过update命令更新的。<br>而upgrade会把本地已安装的软件，与刚下载的软件列表里对应软件进行对比，如果发现已安装的软件版本太低，就会提示你更新。</p>
</li>
</ul>
<h1 id="4-安装图形化界面并完善中文系统"><a href="#4-安装图形化界面并完善中文系统" class="headerlink" title="4.安装图形化界面并完善中文系统"></a>4.安装图形化界面并完善中文系统</h1><ul>
<li><p>1.使用命令 <code>apt-get install gdm3</code>安装图形化界面，完成后系统自动重启，选择gdm3启动。是否在软件更新时重启不提醒，否；下一个选ok；然后经过漫长等待， <code>reboot</code> 重启即可看到图形化界面。</p>
</li>
<li><p>2.安装中文字体，使用命令 <code>apt-get install xfonts-intl-chinese</code> 和 <code>apt-get install ttf-wqy-microhei</code>，</p>
</li>
<li><p>3.切换系统语言 <code>dpkg-reconfigure locales</code> 然后选择字符编码： en_US.UTF-8、zh_CN.GBK、zh_CN.UTF-8 （用空格选定）,接着选择字符： zh_CN.UTF-8作为系统默认语言，重启</p>
</li>
<li><p>4.安装中文输入法并全屏显示</p>
</li>
</ul>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#安装谷歌拼音</span></span><br><span class="line">apt-<span class="built_in">get</span> install fcitx</span><br><span class="line">apt-<span class="built_in">get</span> install fcitx-googlepinyin</span><br><span class="line">reboot</span><br><span class="line"><span class="comment">#解决全屏</span></span><br><span class="line">vim /etc/default/grub</span><br><span class="line"><span class="comment">#修改为</span></span><br><span class="line"><span class="attribute">GRUB_CMDLINE_LINUX_DEFAULT</span>=<span class="string">&quot;quiet splash video=hyperv_fb:1980x1080&quot;</span> <span class="keyword">in</span> /etc/default/grub</span><br><span class="line"><span class="comment">#保存退出，执行下列命令</span></span><br><span class="line">update-grub</span><br><span class="line">reboot</span><br></pre></td></tr></table></figure>

<ul>
<li>5.命令行与图形化界面切换</li>
</ul>
<p><code>init 3</code> 命令行界面,但中文系统会乱码<br><code>init 5</code> 图形化界面</p>
<h1 id="5-不推荐做法"><a href="#5-不推荐做法" class="headerlink" title="5.不推荐做法"></a>5.不推荐做法</h1><p><code>vim /etc/default/console-steup</code><br>修改其内容为：</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">ACTIVE_CONSOLES</span>=<span class="string">&quot;/dev/tty[1-6]&quot;</span></span><br><span class="line"><span class="attr">CHARMAP</span>=<span class="string">&quot;UTF-8&quot;</span></span><br><span class="line"><span class="attr">CODESET</span>=<span class="string">&quot;guess&quot;</span></span><br><span class="line"><span class="attr">FONTFACE</span>=<span class="string">&quot;TerminusBold&quot;</span></span><br><span class="line"><span class="attr">FONTSIZE</span>=<span class="string">&quot;16x32&quot;</span></span><br></pre></td></tr></table></figure>
<p>改完发现没啥用，还是要用<code>Ctrl + Shift + +</code> 来放大字体<br>接下来安装gnome桌面，重启后发现浏览器收藏页面没了，而且更卡了，若要安装这个桌面，建议分配内存2G以上</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">apt-<span class="built_in">get</span> install gnome-core kali-defaults kali-root-login desktop-base</span><br><span class="line">apt-<span class="built_in">get</span> install gnome-session-flashback</span><br><span class="line">apt-<span class="built_in">get</span> install gnome-tweak-tool</span><br></pre></td></tr></table></figure>
<p>然后给浏览器添加gnome插件：<a target="_blank" rel="noopener" href="http://extensions.gnome.org/">http://extensions.gnome.org</a></p>
<hr>

        
            <div class="donate-container">
    <div class="donate-button">
        <button id="donate-button">赞赏</button>
    </div>
    <div class="donate-img-container hide" id="donate-img-container">
        <img id="donate-img" src="" data-src="/myblog/img/donate.jpg">
        <p> 感谢鼓励 </p>
    </div>
</div>
        
        <br />
        <div id="comment-container">
        </div>
        <div id="disqus_thread"></div>
        <div id="lv-container"></div>
        <div class="giscus"></div>
    </div>
</div>

    </div>
</div>


<footer class="footer">
    <ul class="list-inline text-center">
        
        

        

        

        
        <li>
            <a target="_blank"  href="https://github.com/samuel-24276">
                            <span class="fa-stack fa-lg">
                                <i class="iconfont icon-github"></i>
                            </span>
            </a>
        </li>
        

        

    </ul>
    
    <p>
        <span>/</span>
        
        <span><a target="_blank" rel="noopener" href="https://github.com/samuel-24276">samuel-24276&#39;s Page</a></span>
        <span>/</span>
        
        <span><a target="_blank" rel="noopener" href="https://beian.miit.gov.cn/">北京-未备案</a></span>
        <span>/</span>
        
        <span><a href="#">返回顶部</a></span>
        <span>/</span>
        
    </p>
    
    <p>
        <span id="busuanzi_container_site_pv">
            <span id="busuanzi_value_site_pv"></span>PV
        </span>
        <span id="busuanzi_container_site_uv">
            <span id="busuanzi_value_site_uv"></span>UV
        </span>
        Created By <a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>  Theme <a target="_blank" rel="noopener" href="https://github.com/aircloud/hexo-theme-aircloud">AirCloud</a></p>
</footer>




</body>

<script>
    // We expose some of the variables needed by the front end
    window.hexo_search_path = "search.json"
    window.hexo_root = "/myblog/"
    window.isPost = true
</script>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>

<script src="/myblog/js/index.js"></script>

<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>






    <script type="text/javascript">
       (function() {
           if (typeof LivereTower === 'function') { return; }

           var j, d = document.getElementById('lv-container');

           d.setAttribute('data-id','city');
           d.setAttribute('data-uid' , 'MTAyMC80OTA5OC8yNTU5Mw==');

           j = document.createElement('script');
           j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
           j.async = true;

           d.appendChild(j);
       })();
    </script>
    <noscript>为正常使用来必力评论功能请激活JavaScript</noscript>
    </div>

</html>
